//
//  QuestionCell_Detail.m
//  zhijian
//
//  Created by lcb on 2019/2/24.
//  Copyright © 2019 lcb. All rights reserved.
//

#import "QuestionCell_Detail.h"
#import "QuestionModel.h"
@implementation QuestionCell_Detail

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 设置约束
        CGFloat margin = 10;
        
        self.userView.sd_layout
        .leftSpaceToView(self.contentView,0)
        .rightSpaceToView(self.contentView,0)
        .topSpaceToView(self.contentView,0)
        .heightIs(50);
        //
        self.lblTitle.sd_layout
        .topSpaceToView(self.userView,margin)
        .leftSpaceToView(self.contentView,margin)
        .rightSpaceToView(self.contentView,margin)
        .autoHeightRatio(0);
        
        //
        self.operateView.sd_layout
        .leftSpaceToView(self.contentView,0)
        .rightSpaceToView(self.contentView,0)
        .topSpaceToView(self.lblTitle,margin)
        .heightIs(39);
        
        
        [self setupAutoHeightWithBottomView:self.operateView bottomMargin:0];
    }
    return self;
}
-(void)dealloc
{
    self.lblTitle=nil;
    self.userView=nil;
    self.operateView=nil;
}
-(void)setBaseModel:(BaseModel *)baseModel
{
    QuestionModel*questionModel = (QuestionModel*)baseModel;
    self.userView.baseModel = baseModel;
    self.operateView.baseModel = baseModel;
    self.lblTitle.contentString = questionModel.questionContent;
}

@end
